export const list2tree = (list) => {
  if (!list || !list.length) {
    return null
  }
  for (let i in list) {
    const children = list2tree(list[i].children)
    let source = list[i]
    list[i] = {
      value: source.id,
      label: source.title,
      children: children
    }
  }
  return list
}
